package Client;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder;
	


public class MultipleOptions {
	List<Option> options;

	
	public MultipleOptions(int action) {
	
		options = new ArrayList<Option>();
		Option opt = null;
		if(action == 1 || action == 0){// backup\restore file
			OptionBuilder.withDescription("The name of the file");
		    OptionBuilder.hasArg();
		    OptionBuilder.withArgName("file_name");
		    OptionBuilder.isRequired();
		    opt = OptionBuilder.create("file");
		    options.add(opt);
		}
		else{// if(action <= 5){// dir action
			OptionBuilder.withDescription("The name of the directory");
		    OptionBuilder.hasArg();
		    OptionBuilder.withArgName("directory_name");
		    OptionBuilder.isRequired();
		    opt = OptionBuilder.create("dir"); 
		    options.add(opt);
		}
       	 
		 if(action == 1 || action > 2 && action != 5){// not a backup action - snapshot
			 OptionBuilder.withDescription("The id of the snapshot");
		     OptionBuilder.hasArg();
			 OptionBuilder.withArgName("snapshot_id");
			 if(action == 6 || action == 7){
				 OptionBuilder.isRequired();
			 }
			 opt = OptionBuilder.create("snapshot");
			 options.add(opt);
		 }
		 
		 OptionBuilder.withDescription("The name of the user");
	     OptionBuilder.hasArg();
		 OptionBuilder.withArgName("user_name");
		 opt = OptionBuilder.create("user");
		 options.add(opt);
		    
	}


	public List<Option> getOptions() {
		return options;
	}
}
		
	

	
	
	
	
	

